package com.cpr.demo.controller;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Chen Panrui
 * created at 2021/8/31 15:33
 */
@RestController
@RequestMapping("/me")
@Slf4j
@RequiredArgsConstructor
public class MeController {

    private final StringRedisTemplate stringRedisTemplate;

    @GetMapping
    @ResponseBody
    public String me(){
        String me = stringRedisTemplate.boundValueOps("me").get();
        return me;
    }
}
